package
{
	import flash.display.Sprite;
	import flash.display.Graphics;
	
	public class Board extends Sprite implements IUpdater
	{
		public function Board()
		{
			draw();
		}
		/**
		 * 
		 * 
		 */		
		private function draw():void
		{
			var g:Graphics = this.graphics;
			g.beginFill( 0x00ff00 );
			g.drawRect(-100,-20,200,40);
			g.endFill();
		}
		
		/**
		 * 更新位置 
		 * 
		 */		
		public function update():void
		{
			x = stage.mouseX;
			
			if( x < width / 2 )
			{
				x = width / 2;
			}else if( x > stage.stageWidth - width / 2 )
			{
				x = stage.stageWidth - width / 2;
			}
		}
	}
}